using System;
using System.Collections.Generic;
using System.Text;

namespace SqlBlocks.Drivers
{
	public interface IDatabaseDriver
	{
		/// <summary>
		/// Commits a set of changes to the database
		/// </summary>
		/// <param name="db">The database changes</param>
		/// <param name="version">The current changeset version</param>
		void Commit(Changeset db, double version);
		/// <summary>
		/// Gets (or initailizes) database version
		/// </summary>
		/// <param name="connectionString">The database's connection string</param>
		/// <returns>The current database version</returns>
		double CheckVersion(string connectionString);

        /// <summary>
        /// Gets (or initializes) the database version for the specified migration group
        /// </summary>
        /// <param name="connectionString">The database's connection string</param>
        /// <param name="group">The migration group version to check</param>
        /// <returns>The current database version for the migration group</returns>
        double CheckVersion(string connectionString, string group);

        /// <summary>
        /// Dumps the database structure to a script
        /// </summary>
        /// <param name="connectionString">The database to dump</param>
        /// <returns>A string containing the necessary SQL to recreate the database structure</returns>
        string DumpSchema(string connectionString);

        ///// <summary>
        ///// Builds the database from the schema information
        ///// </summary>
        ///// <param name="connectionString">The database to operate on</param>
        ///// <param name="schema">The schema statements</param>
        //void LoadSchema(string connectionString, string schema);
	}
}
